interface Readonly2Todo {
  title: string
  description: string
  completed: boolean
}

const readonly2Todo: MyReadonly2<Readonly2Todo, 'title' | 'description'> = {
  title: "Hey",
  description: "foobar",
  completed: false,
}

// readonly2Todo.title = "Hello" // Error: cannot reassign a readonly property
// readonly2Todo.description = "barFoo" // Error: cannot reassign a readonly property
readonly2Todo.completed = true // OK

type MyReadonly2<T, S extends keyof T> = {
  readonly [K in S]: T[K]
} & {
    [K in Exclude<keyof T, S>]: T[K]
  }